export const zoomSizes = [25, 40, 50, 60, 80, 100];
export const defaultZoomSizeIndex = 1;
export const MAX_LAYER_NAME_LENGTH = 30;
export const MAX_HISTORY_COUNT = 100;

export const DEFAULT_SCREEN_SIZE = '1910x1000';

export enum LayerTypeBE {
  Image = 'image',
  Text = 'text',
  Shape = 'graphics',
  Product = 'item'
}

export enum LayerSubTypeBE {
  Rectangular = 'rectangular',
  Ellipse = 'ellipse',
  Line = 'line',
  Arrow = 'arrow',
  Triangular = 'triangular'
}

export enum LayerTypeFE {
  Image = 'image',
  Rect = 'rect',
  Ellipse = 'ellipse',
  // 自定义
  Triangular = 'roundTriangle',
  Arrow = 'arrow',
  Line = 'shortLine'
}

export const mapSubTypeToBE = {
  [LayerTypeFE.Arrow]: LayerSubTypeBE.Arrow,
  [LayerTypeFE.Rect]: LayerSubTypeBE.Rectangular,
  [LayerTypeFE.Line]: LayerSubTypeBE.Line,
  [LayerTypeFE.Triangular]: LayerSubTypeBE.Triangular,
  [LayerTypeFE.Ellipse]: LayerSubTypeBE.Ellipse
};

export const getLayerTypeFEByBE = (
  layerType: LayerTypeBE,
  subtype?: LayerSubTypeBE
): LayerTypeFE => {
  if (layerType !== LayerTypeBE.Shape) {
    return LayerTypeFE.Image;
  }

  const mapSubTypeToFE = {
    [LayerSubTypeBE.Arrow]: LayerTypeFE.Arrow,
    [LayerSubTypeBE.Rectangular]: LayerTypeFE.Rect,
    [LayerSubTypeBE.Line]: LayerTypeFE.Line,
    [LayerSubTypeBE.Triangular]: LayerTypeFE.Triangular,
    [LayerSubTypeBE.Ellipse]: LayerTypeFE.Ellipse
  };

  return subtype ? mapSubTypeToFE[subtype] : LayerTypeFE.Rect;
};

export const TYPOGRAPHY = {
  ShopeeFont: {
    fontWeight: 400
  },
  Roboto: {
    fontWeight: 500
  },
  RobotoBlack: {
    color: 'black',
    fontWeight: 700
  },
  SukhumvitSet: {
    fontWeight: 300
  },
  SourceHanSansCN: {
    fontWeight: 400
  },
  SourceHanSansTW: {
    fontWeight: 400
  }
};

export const SHOPEE_FONT = 'ShopeeFont';
export const SHOPEE_FONT_DEFAULT = 'ShopeeFont-Regular';

export const SHOPEE_FONT_TYPOGRAPHY = [
  'Black',
  'Bold',
  'ExtraBold',
  'Light',
  'Medium',
  'Regular',
  'SemiBold',
  'RoundedBlack',
  'RoundedBold',
  'RoundedExtraBold',
  'RoundedLight',
  'RoundedMedium',
  'RoundedRegular',
  'RoundedSemiBold'
];

export const FONTSIZE_LIST = [
  16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52,
  54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90,
  92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120
];

export const DEFAULT_ACTIVE_LAYER = 'frame';
